﻿using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using TimServerSDK.Core.Enums;

namespace TimServerSDK.Groups.Dtos
{
    [Serializable]
    public class CreateGroupInputDto
    {
        public string Owner_Account { get; set; }

        /// <summary>
        /// （必填）群组形态
        /// </summary>
        [JsonConverter(typeof(StringEnumConverter))]
        public TimServerGroupTypeEnum Type { get; set; }

        public string GroupId { get; set; }

        /// <summary>
        /// （必填）群名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 群简介
        /// </summary>
        public string Introduction { get; set; }

        /// <summary>
        /// 群公告
        /// </summary>
        public string Notification { get; set; }

        /// <summary>
        /// 群头像 URL
        /// </summary>
        public string FaceUrl { get; set; }

        public int? MaxMemberCount { get; set; }

        /// <summary>
        /// 申请加群处理方式
        /// </summary>
        [JsonConverter(typeof(StringEnumConverter))]
        public TimServerApplyJoinEnum ApplyJoinOption { get; set; } = TimServerApplyJoinEnum.NeedPermission;

        public Appdefineddata[] AppDefinedData { get; set; }
        public Memberlist[] MemberList { get; set; }



        public class Appdefineddata
        {
            public string Key { get; set; }
            public string Value { get; set; }
        }

        public class Memberlist
        {
            public string Member_Account { get; set; }
            public string Role { get; set; }
            public Appmemberdefineddata[] AppMemberDefinedData { get; set; }
        }

        public class Appmemberdefineddata
        {
            public string Key { get; set; }
            public string Value { get; set; }
        }
    }
}
